Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Windows.Forms

Public Class FrmCrTheQuyTienMat_ChiTiet
    Private tungay As String
    Private denngay As String
    Private customerReport As ReportDocument

    Private Sub FrmCrTheQuyTienMat_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        frmLoading.Show()
        Dim sqlQuery As String = "SELECT t1.*, t1.tkDoi as TKDoiung FROM tbl_dot_temp_thetienmat as t1 order by ngay"
        Dim reportPath = Application.StartupPath & "\" & "crTheQuyTienMat_ChiTiet.rpt"
        customerReport = New ReportDocument()
        customerReport.Load(reportPath)
        customerReport.SetDataSource(moduleReportConfig.GetDataTable(sqlQuery))
        customerReport.SetParameterValue("tungay", tungay)
        customerReport.SetParameterValue("denngay", denngay)
        customerReport.SetParameterValue("ketoantruong", globalVariale.KETOANTRUONG)
        customerReport.SetParameterValue("giamdoc", globalVariale.TONGGIAMDOC)
        customerReport.SetParameterValue("thuquy", globalVariale.THUQUY)
        Me.CrNXTTongHopview.ReportSource = customerReport
        frmLoading.Close()
        frmLoading.Dispose()
    End Sub

    Public Sub setTuNgay(ByVal s As Date)
        tungay = s
    End Sub
    Public Sub setDenNgay(ByVal s As Date)
        denngay = s
    End Sub

End Class
